<template>
	<view>
		<view class="">
			<!-- 2.0.19支持autoBack，默认为false -->
			<u-navbar leftText="巡查记录" :autoBack="true">
			</u-navbar>
		</view>
		<view class="con-body" style="padding-left: 20rpx; padding-right: 20rpx; background-color: #FEFEFE;">
			<view style="height: 20rpx;"></view>
			<u-cell-group>
				<u-cell v-for="(item,index) in list" :title="item.name"
					:label="' 设备编号：' + item.code + '\\n' + '设备信息：' + item.desc + '\\n' + '设备坐标：' + item.address">
					<view slot="icon" style="margin-right: 10rpx;">
						<u-icon :name="item.image" :customStyle="{borderRadius: '10px'}" size="80"></u-icon>
					</view>
					<view slot="value" style="font-size: 26rpx;">
						<view v-if="item.complete == 1" style="color: forestgreen;">
							<view>今日已检测</view>
							<view v-if="item.status == 1"
								style="font-size: 28rpx;text-align: center;background-color: forestgreen;color: white;border-radius: 10rpx;margin-top: 20rpx;">
								正常</view>
							<view v-else
								style="font-size: 28rpx;text-align: center;background-color: red;color: #FEFEFE;border-radius: 10rpx;margin-top: 20rpx;">异常
							</view>
						</view>
						<view v-else style="color: orange;">今日未检测</view>
					</view>
				</u-cell>
			</u-cell-group>
		</view>
	</view>
</template>

<script>
	import {
		getPatrolList
	} from "@/service/propertyService.js";
	export default {
		data() {
			return {
				list: []
			}
		},
		onLoad() {
			getPatrolList().then(this.getPatrolList);
		},
		methods: {
			getPatrolList(e) {
				if (e.code == 200) {
					this.list = e.result;
				}
			}
		}
	}
</script>

<style>
</style>
